<?php
require_once 'FactoryModel.php';

/**
 * Implémentation d'une factory du model
 * 
 * @author Cyril Souti
 * @version 1.0
 * @package factory
 *
 */
class Factory_FactoryModelDefault implements Factory_FactoryModel {
	
	private $langage = null;
	private $langageMap = null;
	private $log = null;
	private $traduction = null;
	private $rubrique = null;
	private $article = null;
	
	/**
	 * Initialise la factory avec un plugin loader
	 */
	public function __construct()
    {
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getLangage()
     */
    public function getLangage()
    {
    	if (is_null($this->langage))
    	{
    		$this->langage = new Models_Core_Langage();
    	}
    	return $this->langage;
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getLangageMap()
     */
    public function getLangageMap()
    {
    	if (is_null($this->langageMap))
    	{
    		$this->langageMap = new Models_Core_LangageMap();
    	}
    	return $this->langageMap;
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getLog()
     */
    public function getLog()
    {
    	if (is_null($this->log))
    	{
    		$this->log = new Models_Core_Log();
    	}
    	return $this->log;
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getTraduction()
     */
    public function getTraduction()
    {
    	if (is_null($this->traduction))
    	{
    		$this->traduction = new Models_Core_Traduction();
    	}
    	return $this->traduction;
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getRubrique()
     */
    public function getRubrique()
    {
    	if (is_null($this->rubrique))
    	{
    		$this->rubrique = new Models_Content_Rubrique();
    	}
    	return $this->rubrique;
    }
    
    /**
     * (non-PHPdoc)
     * @see models/factory/Models_Factory_FactoryModel#getArticle()
     */
    public function getArticle()
    {
    	if (is_null($this->article))
    	{
    		$this->article = new Models_Content_Article();
    	}
    	return $this->article;
    }
}